Class SIFGraphIO

java.lang.Object
edu.claflin.finder.io.graph.SIFGraphIO
All Implemented Interfaces:
GraphReader, GraphWriter

public final class SIFGraphIO extends Object implements GraphReader, GraphWriter
A class for reading and writing graphs in the SIF format. The SIF, or Simple Interaction File, format is outlined in detail here:
Version:
3.1.1 February 2, 2016
Author:
Charles Allen Schultz II
  • Constructor Details

    • SIFGraphIO

      public SIFGraphIO()
  • Method Details

    • parseGraph

      public Graph parseGraph(File source, boolean undirected)
      Reads a graph from memory. Reads SIF Style graphs.
      Specified by:
      parseGraph in interface GraphReader
      Parameters:
      source - the File object representing the graph in memory.
      undirected - This boolean is IGNORED as SIF graphs are NOT undirected.
      Returns:
      the read Graph
    • writeGraph

      public void writeGraph(Graph toWrite)
      Writes graphs to memory. Writes SIF Style graphs.
      Specified by:
      writeGraph in interface GraphWriter
      Parameters:
      toWrite - the Graph object to write to memory.
    • testFile

      private static boolean testFile(File file)
      Tests to see if a File is a valid graph file. Currently only tests by checking to ensure the provided file is not a directory.
      Parameters:
      file - the File to test.
      Returns:
      the boolean value representing if the file is valid.